<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>StreamDeck + VDO.Ninja Mixer - Quick Setup Guide</title>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', sans-serif;
            background: #f5f7fa;
            color: #333;
            line-height: 1.6;
        }

        .container {
            max-width: 900px;
            margin: 0 auto;
            padding: 40px 20px;
        }

        header {
            text-align: center;
            margin-bottom: 60px;
        }

        h1 {
            font-size: 2.5em;
            color: #1e2937;
            margin-bottom: 10px;
        }
		
		h4, h3 {
			display: inline;
		}

        .subtitle {
            font-size: 1.2em;
            color: #6b7280;
        }

        .highlight-box {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 30px;
            border-radius: 12px;
            margin-bottom: 40px;
            box-shadow: 0 10px 25px rgba(102, 126, 234, 0.15);
        }

        .step-container {
            background: white;
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
            margin-bottom: 40px;
            overflow: hidden;
        }

        .step-header {
            background: #f8fafc;
            padding: 20px;
            border-bottom: 1px solid #e5e7eb;
        }

        .step-number {
            display: inline-block;
            width: 36px;
            height: 36px;
            background: #667eea;
            color: white;
            border-radius: 50%;
            text-align: center;
            line-height: 36px;
            font-weight: 600;
            margin-right: 12px;
        }

        .step-content {
            padding: 30px;
        }

        .code-block {
            background: #f8fafc;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 16px;
            margin: 15px 0;
            font-family: 'Courier New', monospace;
            white-space: pre-wrap;
            word-break: break-all;
        }

        .command-table {
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
        }

        .command-table th,
        .command-table td {
            padding: 12px;
            text-align: left;
            border: 1px solid #e5e7eb;
        }

        .command-table th {
            background: #f8fafc;
            font-weight: 600;
            color: #374151;
        }

        .command-table tr:nth-child(even) {
            background: #f9fafb;
        }

        .tip-box {
            background: #eff6ff;
            border: 1px solid #dbeafe;
            border-radius: 8px;
            padding: 16px;
            margin: 20px 0;
        }

        .tip-icon {
            color: #3b82f6;
            margin-right: 8px;
        }

        .warning-box {
            background: #fef3c7;
            border: 1px solid #fde68a;
            border-radius: 8px;
            padding: 16px;
            margin: 20px 0;
        }

        .warning-icon {
            color: #f59e0b;
            margin-right: 8px;
        }

        .section-title {
            font-size: 1.5em;
            color: #1e2937;
            margin: 40px 0 20px 0;
            border-bottom: 2px solid #e5e7eb;
            padding-bottom: 10px;
        }

        .layout-showcase {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 20px;
            margin: 30px 0;
        }

        .layout-card {
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 20px;
            text-align: center;
        }

        .layout-visual {
            width: 100%;
            height: 120px;
            background: #f3f4f6;
            border-radius: 6px;
            margin-bottom: 15px;
            position: relative;
            overflow: hidden;
        }

        .layout-grid {
            position: absolute;
            top: 10px;
            left: 10px;
            right: 10px;
            bottom: 10px;
            display: grid;
            gap: 2px;
        }

        .layout-cell {
            background: #667eea;
            border-radius: 2px;
        }

        .layout-label {
            font-weight: 600;
            color: #374151;
        }

        .streamdeck-button {
            background: #374151;
            color: white;
            border: none;
            padding: 12px 30px;
            border-radius: 6px;
            font-weight: 500;
            cursor: not-allowed; /* Indicates these are examples, not clickable here */
            margin: 10px;
            display: inline-block;
        }

        footer {
            text-align: center;
            margin-top: 60px;
            padding-top: 30px;
            border-top: 1px solid #e5e7eb;
            color: #6b7280;
        }

        .important {
            background: #fecaca;
            padding: 4px 8px;
            border-radius: 4px;
            color: #991b1b;
            font-weight: 500;
        }
        li {
            margin-bottom: 10px;
        }
        ul {
            margin-left: 20px;
            margin-top: 10px;
        }
		
		.site-footer {
            background-color: #f0f0f0;
            color: #333;
            text-align: center;
            padding: 20px 0;
            font-size: 0.9em;
            border-top: 1px solid #ddd;
        }
        .site-footer a {
            color: #007bff;
            text-decoration: none;
        }
        .site-footer a:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <div class="container">
        <header>
            <h1>StreamDeck + VDO.Ninja Mixer</h1>
            <p class="subtitle">Professional control made simple - no MIDI required!</p>
        </header>

        <div class="highlight-box">
            <h2 style="margin-bottom: 15px;">🎥 Welcome to VDO.Ninja Control!</h2>
            <p>Tired of limited control in other streaming platforms? VDO.Ninja's API lets you create a professional control setup using your Elgato StreamDeck. Switch between layouts, control cameras, manage guests - all with simple HTTP GET requests!</p>
        </div>

        <div class="step-container">
            <div class="step-header">
                <span class="step-number">1</span>
                <h3>Generate Your API Key</h3>
            </div>
            <div class="step-content">
                <p>First, choose a unique API key. This key links your StreamDeck commands to your VDO.Ninja mixer session. It should be hard for others to guess.</p>
                <div class="code-block">Your API Key: <span class="important">YOUR_UNIQUE_API_KEY</span> (e.g., MySecretMixerKey2025)</div>
                <div class="tip-box">
                    <span class="tip-icon">💡</span>
                    <strong>Tip:</strong> Make your API key memorable for you but secure. You'll need to use this exact same key in both VDO.Ninja and your StreamDeck button configurations. It can be any combination of letters and numbers that you make up.
                </div>
            </div>
        </div>

        <div class="step-container">
            <div class="step-header">
                <span class="step-number">2</span>
                <h3>Open VDO.Ninja Mixer with API Enabled</h3>
            </div>
            <div class="step-content">
                <p>Open your VDO.Ninja Mixer page in your browser, adding your API key as a URL parameter. Replace `YOUR_UNIQUE_API_KEY` with the key you chose in Step 1:</p>
                <div class="code-block">https://vdo.ninja/mixer?api=YOUR_UNIQUE_API_KEY</div>
                <p>If your mixer URL already has other parameters (e.g., `?room=MyRoom`), add the API key with an ampersand (`&`):</p>
                <div class="code-block">https://vdo.ninja/mixer?room=MyRoom&api=YOUR_UNIQUE_API_KEY</div>
                <p>This allows the mixer page to listen for commands associated with your API key.</p>
                <div class="warning-box">
                    <span class="warning-icon">⚠️</span>
                    <strong>Important:</strong> You <span class="important">must</span> add the `?api=YOUR_UNIQUE_API_KEY` (or `&api=YOUR_UNIQUE_API_KEY`) parameter to your VDO.Ninja Mixer URL, otherwise, the StreamDeck commands will not work! The VDO.Ninja page needs to be open and have this API key in its URL to receive commands.
                </div>
            </div>
        </div>

        <div class="step-container">
            <div class="step-header">
                <span class="step-number">3</span>
                <h3>Configure StreamDeck Buttons for HTTP Requests</h3>
            </div>
            <div class="step-content">
                <p>On your Stream Deck, you'll create buttons that send HTTP GET requests to the VDO.Ninja API.</p>
                <p><strong>The recommended method for simplicity is using the Stream Deck's built-in "Website" action:</strong></p>
                <ul>
                    <li>Open the Stream Deck software on your computer.</li>
                    <li>From the actions list on the right (usually categorized), find the "System" category.</li>
                    <li>Drag the "Website" action onto an empty key on your Stream Deck layout.</li>
                    <li>Configure the "Website" action for the key:
                        <ul>
                            <li><strong>Title:</strong> Give your button a descriptive name (e.g., "Layout 0", "Mute Mic").</li>
                            <li><strong>URL:</strong> This is where you'll put the VDO.Ninja API command URL (see examples below). Make sure to replace `YOUR_UNIQUE_API_KEY` in the URL with the key you chose in Step 1.</li>
                            <li><strong>Access in background:</strong> <span class="important">Crucially, ensure this checkbox is CHECKED.</span> This makes the Stream Deck send the request without trying to open a web browser window.</li>
                        </ul>
                    </li>
                </ul>
                <div class="tip-box">
                    <span class="tip-icon">💡</span>
                    <strong>Alternative (Advanced):</strong> For more complex needs (not typically required for VDO.Ninja's basic API), you could explore Stream Deck plugins specifically designed for API/HTTP requests (e.g., "API Ninja" by BarRaider or "HTTP GET Request"). These offer more options like custom headers or parsing responses, but the "Website" action is sufficient for these commands.
                </div>

                <p style="margin-top: 20px;"><strong>Understanding the API URL Structure:</strong></p>
                <p>The general format for the VDO.Ninja API URLs you'll use is:</p>
                <div class="code-block">https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/action/target/value</div>
                <ul>
                    <li><code>YOUR_UNIQUE_API_KEY</code>: The key from Step 1.</li>
                    <li><code>action</code>: The command to perform (e.g., `layout`, `mic`, `camera`).</li>
                    <li><code>target</code>: Who or what the action applies to. For self-control in the mixer or for layout changes, this is often `null`. For guest control, it could be a guest slot number (e.g., `1`, `2`).</li>
                    <li><code>value</code>: The specific setting for the action (e.g., a layout number like `0` or `1`, or `toggle`, `true`, `false`).</li>
                </ul>
                <p>If a parameter like `target` or `value` is not needed for a specific command, it's often represented by `null` in the URL path. <span class="important">Do not use double slashes (//) if a middle parameter is `null`. Always include `null` as part of the path.</span></p>

                <h4 style="margin-top: 30px;">Layout Controls (Defaults)</h4>
                <p>Assign these URLs to Stream Deck "Website" actions to switch VDO.Ninja Mixer layouts. Remember to replace `YOUR_UNIQUE_API_KEY`.</p>
                <div class="layout-showcase">
                    <div class="layout-card">
                        <div class="layout-visual">
                            <div class="layout-grid" style="grid-template-columns: 1fr; grid-template-rows: 1fr;">
                                <div class="layout-cell"></div>
                            </div>
                        </div>
                        <div class="layout-label">Auto Mix (Layout 0)</div>
                        <div class="code-block" style="font-size: 0.9em;">https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/layout/null/0</div>
                    </div>
                    <div class="layout-card">
                        <div class="layout-visual">
                            <div class="layout-grid" style="grid-template-columns: 1fr; grid-template-rows: 1fr;">
                                <div class="layout-cell"></div>
                            </div>
                        </div>
                        <div class="layout-label">Layout 1</div>
                        <div class="code-block" style="font-size: 0.9em;">https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/layout/null/1</div>
                    </div>
                    <div class="layout-card">
                        <div class="layout-visual">
                            <div class="layout-grid" style="grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(1, 1fr);">
                                <div class="layout-cell"></div>
                                <div class="layout-cell"></div>
                            </div>
                        </div>
                        <div class="layout-label">Layout 5</div>
                        <div class="code-block" style="font-size: 0.9em;">https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/layout/null/5</div>
                    </div>
                    <div class="layout-card">
                        <div class="layout-visual">
                            <div class="layout-grid" style="grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr);">
                                <div class="layout-cell"></div>
                                <div class="layout-cell"></div>
                                <div class="layout-cell"></div>
                                <div class="layout-cell"></div>
                            </div>
                        </div>
                        <div class="layout-label">Layout 7</div>
                        <div class="code-block" style="font-size: 0.9em;">https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/layout/null/7</div>
                    </div>
                </div>

                <h4 style="margin-top: 40px;">Essential Controls (Self)</h4>
                <p>These commands control your own VDO.Ninja instance (the one with the `?api=` parameter). The `target` is `null` as these actions apply to the VDO.Ninja instance itself.</p>
                <table class="command-table">
                    <tr>
                        <th>Button Label (Suggestion)</th>
                        <th>URL Command (for StreamDeck "Website" action)</th>
                        <th>Function</th>
                    </tr>
                    <tr>
                        <td>🎤 Mute/Unmute Mic</td>
                        <td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/mic/null/toggle</code></td>
                        <td>Toggle your microphone on/off</td>
                    </tr>
                    <tr>
                        <td>📹 Mute/Unmute Cam</td>
                        <td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/camera/null/toggle</code></td>
                        <td>Toggle your camera on/off</td>
                    </tr>
                    <tr>
                        <td>🔴 Start Record</td>
                        <td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/record/null/true</code></td>
                        <td>Start recording (local)</td>
                    </tr>
                    <tr>
                        <td>⏹️ Stop Record</td>
                        <td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/record/null/false</code></td>
                        <td>Stop recording (local)</td>
                    </tr>
                    <tr>
                        <td>✋ Toggle Hand</td>
                        <td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/togglehand/null/null</code></td>
                        <td>Raise/lower your hand</td>
                    </tr>
                </table>

                <h4 style="margin-top: 40px;">Guest Control (For Directors)</h4>
                <p>If you are using the Director role and have guests in slots, you can control them. Replace `SLOT_NUMBER` with the guest's slot (e.g., `1`, `2`, etc.).</p>
                <table class="command-table">
                    <tr>
                        <th>Button Label (Suggestion)</th>
                        <th>URL Command (Example for Guest in Slot 1)</th>
                        <th>Function</th>
                    </tr>
                    <tr>
                        <td>Mute Guest 1</td>
                        <td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/mic/1/toggle</code></td>
                        <td>Toggle Guest 1's microphone</td>
                    </tr>
                    <tr>
                        <td>Cam Off Guest 1</td>
                        <td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/camera/1/false</code></td>
                        <td>Turn Guest 1's camera off</td>
                    </tr>
                    <tr>
                        <td>Add Guest 1 to Scene 0</td>
                        <td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/addScene/1/0</code></td>
                        <td>Toggle Guest 1 in/out of Scene 0 (Auto-Mix/Main Scene)</td>
                    </tr>
                     <tr>
                        <td>Hangup Guest 2</td>
                        <td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/hangup/2/null</code></td>
                        <td>Disconnect guest in slot 2</td>
                    </tr>
                </table>
                
                <div class="warning-box">
                    <span class="warning-icon">⚠️</span>
                    <strong>Crucial Reminder:</strong> Always replace `YOUR_UNIQUE_API_KEY` with your actual API key in all URLs you configure on your StreamDeck buttons! And ensure "Access in background" is checked for each "Website" action.
                </div>
            </div>
        </div>

        <div class="step-container">
            <div class="step-header">
                <span class="step-number">4</span>
                <h3>Advanced Control Options & Full List</h3>
            </div>
            <div class="step-content">
                <p>VDO.Ninja offers many more API commands. For a comprehensive list, please refer to the official API documentation (often found on the Companion-Ninja GitHub or VDO.Ninja docs).</p>
                <p>Here are a few more examples of what's possible:</p>
                
                <h4>Scene Management (Director)</h4>
                <table class="command-table">
                    <tr>
                        <th>Function</th>
                        <th>URL Command (replace `YOUR_UNIQUE_API_KEY`, `GUEST_SLOT`, `SCENE_ID`)</th>
                    </tr>
                    <tr>
                        <td>Add Guest in Slot 1 to Scene 0</td>
                        <td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/addScene/1/0</code></td>
                    </tr>
                    <tr>
                        <td>Mute Guest in Slot 1 in Scene 0</td>
                        <td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/muteScene/1/0</code></td>
                    </tr>
                </table>

                <h4>Group Controls (Director - Self)</h4>
                <table class="command-table">
                    <tr>
                        <th>Function</th>
                        <th>URL Command (replace `YOUR_UNIQUE_API_KEY`, `GROUP_ID`)</th>
                    </tr>
                    <tr>
                        <td>Join Group 1 (Self)</td>
                        <td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/joinGroup/null/1</code></td>
                    </tr>
                    <tr>
                        <td>Leave Group 2 (Self)</td>
                        <td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/leaveGroup/null/2</code></td>
                    </tr>
                    <tr>
                        <td>Toggle Self in/out of Group 3</td>
                        <td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/group/null/3</code></td>
                    </tr>
                </table>

                <h4>Camera Control (PTZ - for compatible cameras, target can be `null` for self or guest slot)</h4>
                <table class="command-table">
                    <tr>
                        <th>Function (Self Camera)</th>
                        <th>URL Command (replace `YOUR_UNIQUE_API_KEY`)</th>
                    </tr>
                    <tr>
                        <td>Zoom In (Self)</td>
                        <td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/zoom/null/0.1</code></td>
                    </tr>
                    <tr>
                        <td>Zoom Out (Self)</td>
                        <td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/zoom/null/-0.1</code></td>
                    </tr>
                    <tr>
                        <td>Pan Left (Self)</td>
                        <td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/pan/null/-0.1</code></td>
                    </tr>
                    <tr>
                        <td>Pan Right (Self)</td>
                        <td><code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/pan/null/0.1</code></td>
                    </tr>
                </table>
                <div class="tip-box">
                    <span class="tip-icon">💡</span>
                    <strong>Targeting Guests for PTZ:</strong> To control a guest's PTZ camera, replace `null` with their guest slot number. For example, to zoom Guest 1's camera in: <code>https://api.vdo.ninja/YOUR_UNIQUE_API_KEY/zoom/1/0.1</code>
                </div>
            </div>
        </div>

        <div class="step-container">
            <div class="step-header">
                <span class="step-number">5</span>
                <h3>Quick Start Examples (StreamDeck Button Ideas)</h3>
            </div>
            <div class="step-content">
                <p>Here are some ideas for StreamDeck button layouts. Remember, you need to create each of these using the "Website" action and the corresponding API URLs as detailed in Step 3.</p>

                <h4>Basic Control Set (for a Performer/Self-Operator)</h4>
                <div style="background: #f3f4f6; padding: 20px; border-radius: 8px; margin: 20px 0;">
                    <p><i>(These are visual examples of how your StreamDeck might look. Each is a "Website" action.)</i></p>
                    <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top:10px;">
                        <div class="streamdeck-button">Layout 0<br>(Auto)</div>
                        <div class="streamdeck-button">Layout 1</div>
                        <div class="streamdeck-button">Layout 2</div>
                        <div class="streamdeck-button">Mute Mic</div>
                        <div class="streamdeck-button">Mute Cam</div>
                        <div class="streamdeck-button">Start Rec</div>
                        <div class="streamdeck-button">Stop Rec</div>
                        <div class="streamdeck-button">Raise Hand</div>
                    </div>
                </div>
                
                <h4>Director Control Set (for managing a show with guests)</h4>
                <div style="background: #f3f4f6; padding: 20px; border-radius: 8px; margin: 20px 0;">
                     <p><i>(These are visual examples of how your StreamDeck might look. Each is a "Website" action.)</i></p>
                    <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top:10px;">
                        <div class="streamdeck-button">Mute G1 Mic</div>
                        <div class="streamdeck-button">Mute G2 Mic</div>
                        <div class="streamdeck-button">G1 to Scene 0</div>
                        <div class="streamdeck-button">G2 to Scene 0</div>
                        <div class="streamdeck-button">Hangup G1</div>
                        <div class="streamdeck-button">Hangup G2</div>
                        <div class="streamdeck-button">Force Key G1</div>
                        <div class="streamdeck-button">Highlight G1</div>
                    </div>
                </div>
            </div>
        </div>

        <div class="highlight-box">
            <h2 style="margin-bottom: 15px;">🚀 You're All Set!</h2>
            <p>With these StreamDeck controls, you now have powerful, tactile command over your VDO.Ninja Mixer sessions. No more frantic clicking through menus during a live production – just press a button for instant control!</p>
            <p style="margin-top: 15px;"><strong>Remember:</strong> Always keep your API key secure and never share it publicly. Ensure the VDO.Ninja Mixer page with the `?api=` parameter is open in your browser for the commands to work.</p>
        </div>
    <footer class="site-footer">
        <p>
            For detailed API options, functions, and information on the Bitfocus Companion plugin,
            please visit the
            <a href="https://github.com/steveseguin/Companion-Ninja" target="_blank" rel="noopener noreferrer">Companion-Ninja GitHub repository</a>.
            The repository includes a comprehensive markdown list.
        </p>
    </footer>
        <footer>
            <p>Created with ❤️ for the VDO.Ninja community</p>
            <p>For detailed API commands and support, visit the VDO.Ninja documentation and the <a href="https://github.com/steveseguin/Companion-Ninja" style="color: #667eea;" target="_blank">Companion-Ninja GitHub</a>.</p>
        </footer>
    </div>
</body>
</html>